OpenBSD Mastery: Filesystems by Unknown
Author:Unknown
Language: eng
Format: epub
ISBN: 0000000000000
Published: 2023-02-15T00:34:46+00:00
Growing Filesystems
You add disks to free up space on your existing disks. Sometimes that disk isnât partitioned the way you want, however. If you combine everything weâve learned, and are lucky, you can change that without reinstalling. Youâll also need basic math, like subtracting large numbers and correctly multiplying seven by nine.
The growfs(8) program lets you expand a filesystem, but itâs trickier than it sounds. A filesystem can only be expanded into empty space immediately after the existing filesystem. If you have an empty partition at the beginning of the disk, but want to grow a filesystem at the end of the disk, youâre out of luck and all you can do is say, âoh no not again.â But letâs see how this works.
The trick to growing a filesystem is that a filesystem is just a bunch of bits on a partition. OpenBSD partitions are just chalk lines between sectors. When you create a filesystem, it grows until it hits the line and stop. By erasing some of those lines, you create a larger partition. You use growfs(8) to tell the filesystem âhey, you have more room.â
One of my hosts has a 1.6GB /usr/local partition. When I installed the host, I thought it was big enough. I was wrong. Letâs see what might be done. Partitions are defined in the disklabel, so letâs look.
â¦
# size offset fstype [fsize bsize cpg]
â¦
g: 1118240 9041472 4.2BSD 2048 16384 8666 # /usr/X11R6
h: 3756224 10159712 4.2BSD 2048 16384 12960 # /usr/local
i: 960 64 MSDOS
j: 3293184 13915936 4.2BSD 2048 16384 12960 # /usr/src
k: 10928160 17209120 4.2BSD 2048 16384 12960 # /usr/obj
l: 5415520 28137280 4.2BSD 2048 16384 12960 # /home
Partition h is /usr/local. It is immediately followed by partition i, the EFI boot partition. You can manipulate disks in many ways, but eliminating the boot loader is frequently counterproductive. But look more closely. Partitions are shown in letter order, not block order. All those horrid size and offset numbers tell the real story. Partition i begins on sector 64 and has an offset of 64 sectors. The only thing in front of it is the actual GUID partition table.
Partition h has a size of 3756224 sectors and an offset of 10159712. The partition that really follows it will have an offset of (3,756,224 + 10,159,712 = ) 13,915,936. Thatâs the offset of partition j, or /usr/src. Adding the size and offset of partition j gives us (3,293,184 + 13,915,936 = ) 17,209,120, the beginning of partition k or /usr/obj.
I perfectly well understand why OpenBSD creates these partitions. Itâs faster to newfs(8) /usr/obj than recursively delete files, and adding the partitions after install is impossible. But this host uses binary updates via sysupgrade(8), and I have many copies of the OpenBSD source tree at hand. These partitions can go away.
Before editing filesystems or partitions on a live system, perform a complete backup. Schedule the work for a time that you could perform a complete reinstall and restore. A basic math error can wreck the system.
We could do this in single-user mode, but I believe Iâm an advanced life form and see no reason to bother.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
What's Done in Darkness by Kayla Perrin(26953)
The Ultimate Python Exercise Book: 700 Practical Exercises for Beginners with Quiz Questions by Copy(20850)
De Souza H. Master the Age of Artificial Intelligences. The Basic Guide...2024 by Unknown(20603)
D:\Jan\FTP\HOL\Work\Alien Breed - Tower Assault CD32 Alien Breed II - The Horror Continues Manual 1.jpg by PDFCreator(20532)
The Fifty Shades Trilogy & Grey by E L James(19452)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(19375)
Shot Through the Heart by Mercy Celeste(19232)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 10 by Isuna Hasekura and Jyuu Ayakura(17381)
Python GUI Applications using PyQt5 : The hands-on guide to build apps with Python by Verdugo Leire(17345)
Peren F. Statistics for Business and Economics...Essential Formulas 3ed 2025 by Unknown(17177)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 03 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(17091)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 01 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16707)
The Subtle Art of Not Giving a F*ck by Mark Manson(14820)
The 3rd Cycle of the Betrayed Series Collection: Extremely Controversial Historical Thrillers (Betrayed Series Boxed set) by McCray Carolyn(14437)
Stepbrother Stories 2 - 21 Taboo Story Collection (Brother Sister Stepbrother Stepsister Taboo Pseudo Incest Family Virgin Creampie Pregnant Forced Pregnancy Breeding) by Roxi Harding(14210)
Cozy crochet hats: 7 Stylish and Beginner-Friendly Patterns from Baby Beanies to Trendy Bucket Hats by Vanilla Lazy(13487)
Scorched Earth by Nick Kyme(13088)
Reichel W. Numerical methods for Electrical Engineering, Meteorology,...2022 by Unknown(12971)
Drei Generationen auf dem Jakobsweg by Stein Pia(11250)